﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sinacor.UI.Bovespa.Ordens.Communication.Bovespa.Cliente.Cliente;
using Sinacor.Infra.Common;
using Sinacor.Infra.UI.Common;

namespace Sinacor.UI.Bovespa.Ordens.Communication.Translator
{
    class TranslatorPosicaoCustodiaResponse :
    BaseTranslator<Model.PosicaoCustodia,
    PosicaoCustodiaResponse,
    ModelCollection<Model.PosicaoCustodia>,
    List<PosicaoCustodiaResponse>>
    {
        public override Model.PosicaoCustodia Translate(PosicaoCustodiaResponse from)
        {
            Model.PosicaoCustodia to = new Model.PosicaoCustodia();
            if (from != null)
            {
                to.Custodias = new TranslatorCustodia().TranslateToList(from.Custodias);
                to.DataPosicao = from.DataPosicao;
            }
            return to;
        }
    }
}

